|
RAIS
3.2
|
00001 using System; 00002 using System.Collections.Generic; 00003 using System.Text; 00004 using NUnit.Framework; 00005 using RAIS.Common.UserManagement; 00006 using RAIS.DataAccessLayer; 00007 00008 namespace RAIS.DataAccessLayerTest.CommonClasses 00009 { 00010 [TestFixture] 00011 public class RegionTest 00012 { 00013 private int expectedID = 1; 00014 private string expectedName = "Test Region"; 00015 00016 private Region region; 00017 00018 [SetUp] 00019 public void Init() 00020 { 00021 region = new Region(); 00022 region.ID = this.expectedID; 00023 region.Name = this.expectedName; 00024 } 00025 [Test] 00026 public void GetID() 00027 { 00028 // Test 00029 Assert.AreEqual(this.expectedID, this.region.ID); 00030 } 00031 [Test] 00032 public void GetName() 00033 { 00034 // Test 00035 Assert.AreEqual(this.expectedName, this.region.Name); 00036 } 00037 [Test] 00038 public void SetName() 00039 { 00040 // Preparation 00041 string expectedNewName = "New Test Region"; 00042 00043 // Test 00044 this.region.Name = expectedNewName; 00045 00046 // Check 00047 Assert.AreEqual(expectedNewName, this.region.Name); 00048 } 00049 [Test] 00050 public void RestricitonsConflict() 00051 { 00052 bool returnStatus; 00053 Region newRegion = new Region(); 00054 newRegion.Name = RAIS.Common.Constants.ALL_REGIONS; 00055 00056 // Test 00057 returnStatus = region.RestricitonsConflict(newRegion); 00058 00059 // Check 00060 Assert.IsTrue(returnStatus, "RestricitonsConflict error:"); 00061 } 00062 } 00063 }